<template>
    <div>
        
        <mt-swipe :auto="3700">
            <mt-swipe-item v-for="item in lunBoTu" :key="item.url">
                <img :src="item.img" alt="">
            </mt-swipe-item>
        </mt-swipe>



        <h3>home组件</h3>
    </div>
</template>
<script>
import { Toast } from 'mint-ui';


    export default {
        data () {
            return {
                lunBoTu: []
            }
        },
        created () {
            this.getLunBoTu()
        },
        methods: {
            getLunBoTu () {
                this.$http.get("http://vue.studyit.io/api/getlunbo").then(result => {
                    if(result.body.status === 0){
                        this.lunBoTu = result.body.message
                    }else{
                        Toast({
                        message: '加载失败',
                        position: 'top',
                        duration: 2000
                        });
                    }
                })
            }
        },
    }
</script>
<style lang="scss" scoped>
    .mint-swipe{
        height: 150px;
        border: 1px solid #111;
        .mint-swipe-item{
            &:nth-child(1){
                background-color: red;
            }
            &:nth-child(2){
                background-color: yellow;
            }
            &:nth-child(3){
                background-color: royalblue;
            }
        }
    }
</style>